package com.longy.common.utils;

import java.util.Date;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;

public class tset {
    private static final AtomicReference<String> ss = new AtomicReference<>("");
    private static final AtomicInteger ssIn = new AtomicInteger(0);
    private static Integer aa = 0;
    static void meth1() {
        meth2();
        String end = ss.get();
        // 明确获取当前值
        System.out.println(end);
    }

    static synchronized void meth2() {
        for (int i = 0; i < 100; i++) {
            int finalI = i;
            new Thread(()->{
                int i1 = ssIn.get();
                ssIn.set((i1 + 1));
                System.out.println(ssIn.get());
            }).start();
        }

    }
    static void meth3() {
        for (int i = 0; i < 100; i++) {
            int finalI = i;
            new Thread(()->{
                aa=aa+1;
                System.out.println(aa);
            }).start();
        }

    }

    public static void main(String[] args) {
        Date date = new Date();
        String str = "2025-02";
    }
}
